]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
shellDBus: Properly return from D-Bus methods
authorFlorian Müllner <fmuellner@gnome.org>
Thu, 17 Jun 2021 13:42:14 +0000 (15:42 +0200)
committerMarge Bot <marge-bot@gnome.org>
Thu, 17 Jun 2021 21:03:58 +0000 (21:03 +0000)
When implementing a D-Bus method synchronously, regular JS methods are
used. That is, whatever the method returns is passed as return value
to the method invocation.

However for asynchronous implementations, we need to explicitly return
a value to the invocation, otherwise the caller will wait until it times
out eventually.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1891>

js/ui/shellDBus.js

index 48e7bb5b891cab9b06af5f7d13e0674d98ac6590..6574cc5288a897df9efb437be359c5eb139d424c 100644 (file)
@@ -217,11 +217,13 @@ var GnomeShell = class {
         let sender = invocation.get_sender();
         let [dict] = params;
         Main.osdMonitorLabeler.show(sender, dict);
+        invocation.return_value(null);
     }
 
     HideMonitorLabelsAsync(params, invocation) {
         let sender = invocation.get_sender();
         Main.osdMonitorLabeler.hide(sender);
+        invocation.return_value(null);
     }
 
     _checkOverviewVisibleChanged() {